package iedcyt.acute.controller.listeners.maesorgPublication;

import iedcyt.acute.model.MaesorgJCRModel;
import iedcyt.acute.model.MaesorgPublicationModel;
import iedcyt.acute.view.MaesorgJCRView;
import iedcyt.acute.view.MaesorgPublicationView;

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

public class DboSelectionListener implements Listener {

	private MaesorgJCRModel _model;
	private MaesorgJCRView _view;
	
	public DboSelectionListener(MaesorgJCRView view, MaesorgJCRModel model) {
		this._model = model;
		this._view = view;
	}
	
	@Override
	public void handleEvent(Event event) {
		Integer idJcr = _view.getSelectedDboIdJcr();
		_model.setSelected_dboIdJcr(idJcr);
		_model.printSelectedDbo();
		_view.loadCandidates(_model.getCandidates());
		
	}
}
